<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/templates/default.xhtml">
	<ui:define name="content">
	
		<h1>Class Information</h1>
		
		<h:form id="class">
			<div class="box-body">
		        <div class="form-group">
		            <label for="name">Name</label>
		            <h:inputText name="name" class="form-control" value="#{classesController.clazz.name}"/>
		        </div>
		        <div class="form-group">
		            <label for="startDate">Start Date</label>
		            <h:inputText name="startDate" class="form-control" value="#{classesController.clazz.startDate}"/>
		        </div>
				<div class="form-group">
		            <label for="endDate">End Date</label>
		            <h:inputText name="endDate" class="form-control" value="#{classesController.clazz.endDate}"/>
		        </div>
				<div class="form-group">
		            <label for="semester">Semester</label>
		            <h:selectOneMenu value="#{classesController.clazz.semester.id}" styleClass="form-control">
	                    <f:selectItems value="#{classesController.semesterList}" var="_semester" itemValue="#{_semester.id}" itemLabel="#{_semester.name}"/>
	                </h:selectOneMenu>
		        </div>
				<div class="form-group">
		            <label for="subject">Subject</label>
		            <h:selectOneMenu value="#{classesController.clazz.subject.id}" styleClass="form-control">
	                    <f:selectItems value="#{classesController.subjectList}" var="_subject" itemValue="_subject.id" itemLabel="#{_subject.name}"/>
	                </h:selectOneMenu>
		        </div>
				<div class="form-group">
		            <label for="maxStudents">Max Students</label>
					<h:inputText name="maxStudents" class="form-control" value="#{classesController.clazz.maxStudents}"/>
		        </div>
			</div>
			<div class="box-footer">
	            <h:commandButton action="#{classesController.doSubmit}" value="Save" styleClass="btn btn-primary"/>
	           	<h:commandButton value="Clear" type="reset" styleClass="btn"/>
	        </div>
		</h:form>

	</ui:define>
</ui:composition>